﻿// =============================================================================
// XPathDebugger And Examples SwapCashFlows.cs
// Copyright (c) 2013 TNTTechnologies Inc.
// =============================================================================

#region

using System;
using System.Collections.Generic;

#endregion

namespace Example{
    public class SwapCashFlows{
        private List<SwapLegCashFlows> fixedLegs = new List<SwapLegCashFlows>();
        private List<SwapLegCashFlows> floatingLegs = new List<SwapLegCashFlows>();

        public List<SwapLegCashFlows> FloatingLegs{
            get{
                return this.floatingLegs;
            }
            set{
                this.floatingLegs = value;
            }
        }

        public List<SwapLegCashFlows> FixedLegs{
            get{
                return this.fixedLegs;
            }
            set{
                this.fixedLegs = value;
            }
        }

        public void FilterByPaymentDateRange(DateTime valuationDate, DateTime cashflowEndDate){
            foreach (SwapLegCashFlows item in this.floatingLegs){
                item.CashFlows.FilterByPaymentDateRange(valuationDate, cashflowEndDate);
            }
            foreach (SwapLegCashFlows item in this.FixedLegs){
                item.CashFlows.FilterByPaymentDateRange(valuationDate, cashflowEndDate);
            }
        }
    }

    public class SwapLegCashFlows{
        private TradeCashFlows cashFlows = new TradeCashFlows();
        public string LegName { get; set; }
        public int CurrencyType { get; set; }

        public TradeCashFlows CashFlows{
            get{
                return this.cashFlows;
            }
            set{
                this.cashFlows = value;
            }
        }
    }
}